package cn.zzm.topic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Service;

@Service
public class ProducerTopic {

    @Autowired
    private JmsTemplate jmsTemplate;

    // 发送消息，destination是发送到的队列，message是待发送的消息
    public void sendMessage(String destination, final String message){
        jmsTemplate.setPubSubDomain(true);
        jmsTemplate.convertAndSend(destination, message);
    }


}
